package com.kk.framework.ui.framewest;

import org.zkoss.zul.Div;
import org.zkoss.zul.Hbox;
import org.zkoss.zul.Image;
import org.zkoss.zul.Label;


@SuppressWarnings("serial")
public class ModuleNavToolbarbutton extends Div
{
	private Image _image;
	private Label _lbl;
	private String _iconPath;
	private String _selectIconPath;
	private String _hoverIconPath;
	private String _pagePath;
	
	public ModuleNavToolbarbutton(String label, String iconPath, String selectIconPath, String hoverIconPath, String pagePath)
	{	
		this.setHeight("40px");
		this.setWidth("240px");
		this.setSclass("module-nav-button");
		
		this._iconPath = iconPath;
		this._selectIconPath = selectIconPath;
		this._hoverIconPath = hoverIconPath;
		this._pagePath = pagePath;
		
		Hbox container = new Hbox();
		this.appendChild(container);
		
		this._image = new Image();
		this._image.setStyle("cursor:pointer;padding-top:8px;padding-left:12px");
		this._image.setSrc(iconPath);
		this._image.setHover(hoverIconPath);
		container.appendChild(this._image);
		
		Div paddingDiv = new Div();
		paddingDiv.setStyle("padding-top:10px;padding-left:10px");
		container.appendChild(paddingDiv);
		
		String lblStyle = 
				"font-weight:bold;" +
				"font-family:\"Microsoft YaHei\";" +
				"font-size:15px;";
		
		this._lbl = new Label();
		this._lbl.setValue(label);
		this._lbl.setStyle(lblStyle);
		paddingDiv.appendChild(this._lbl);
	}
	
	public String getIconPath()
	{
		return this._iconPath;
	}
	
	public String getSelectIconPath()
	{
		return this._selectIconPath;
	}
	
	public String getHoverIconPath()
	{
		return this._hoverIconPath;
	}
	
	public String getPagePath()
	{
		return this._pagePath;
	}
	
	public void setImage(String src)
	{
		this._image.setSrc(src);
	}
	
	public String getImage()
	{
		return this._image.getSrc();
	}
}
